package org.jaronsource.framework.plugins.easyui;

import net.sf.json.JSONObject;

import org.jaronsource.framework.core.dao.support.Page;
import org.jaronsource.framework.util.JsonUtils;



public class EasyUIUtils {

	public static String convertPageToJson(Page<?> page) {
		
		JSONObject jsonObject = new JSONObject();
		jsonObject.element( "rows", JsonUtils.toJson(page.getContent()) );
		jsonObject.element( "total", page.getTotalCount() );
		
		return JsonUtils.toJson(jsonObject);
	};
	
}
